<template>
	<view>
		<view class="priceChange" :class="[change === true ? 'on' : '']">
			<view class="priceTitle">
				新增您的项目
				<span class="iconfont icon-guanbi" @click="close"></span>
			</view>
			
			<!-- 立即参与 -->
			<view class="listChange">
				<view class="item acea-row row-middle">
					<view>项目名称</view>
					<view class="money">
						<input type="text" v-model="name" :class="focus === true ? 'on' : ''" @focus="nameChange" />
					</view>
				</view>
			</view>
			
			<view class="modify" @click="save">提交</view>
			<slot name="bottom"></slot>
		</view>
		<view class="mask" @click="close" v-if="change"></view>
	</view>
</template>

<script>
	export default {
		name: "applyWindow",
		components: {},
		props: {
			change: {
				type: Boolean,
				default: false
			},
			dataer: {
				type: Object,
				default: () => {}
			}
		},
		data: function() {
			return {
				focus: false,
				name: '',
				price: 0,
				phone: '',
				number: 0
			};
		},
		watch: {
			data: function(nVal) {
				this.price = this.dataer.price;
				this.number = this.dataer.number;
			}
		},
		mounted: function() {
			
		},
		methods: {
			nameChange: function() {
				this.focus = true;
			},
			phoneChange: function() {
				this.focus = true;
			},
			numberChange: function() {
				this.focus = true;
			},
			close: function() {
				this.$emit("closeChange", false);
			},
			save: function() {
				let that = this;
				that.$emit("saveApply", {
					name: that.name
				});
			}
		}
	};
</script>

<style lang="scss">
	.mask {
		z-index: 99;
	}

	.priceChange .reGoods {
		padding: 0 25upx;
		margin-top: 50upx;
	}

	.priceChange .reGoods .bnt {
		width: 250upx;
		height: 90upx;
		background-color: #2291f8;
		font-size: 32upx;
		color: #fff;
		text-align: center;
		line-height: 90upx;
		border-radius: 45upx;
	}

	.priceChange .reGoods .bnt.grey {
		background-color: #eee;
		color: #312b2b;
	}

	.priceChange {
		position: fixed;
		width: 580upx;
		height: 450upx;
		background-color: #fff;
		border-radius: 10upx;
		top: 50%;
		left: 50%;
		margin-left: -290upx;
		margin-top: -335upx;
		z-index: 666;
		transition: all 0.3s ease-in-out 0s;
		transform: scale(0);
		opacity: 0;
	}

	.priceChange.on {
		opacity: 1;
		transform: scale(1);
	}

	.priceChange.goodsOn {
		height: 380upx;
	}

	.priceChange .priceTitle {
		width: 100%;
		height: 160upx;
		border-radius: 10upx 10upx 0 0;
		text-align: center;
		font-size: 40upx;
		color: #fff;
		line-height: 160upx;
		position: relative;
		background-image: linear-gradient(45deg,var(--view-theme),var(--view-bntColor),var(--view-theme),var(--view-bntColor),var(--view-theme));
		background-size: 400%;
		animation: bganimation 15s infinite;
		@keyframes bganimation {
			0%{
				background-position: 0% 50%;
			}
			50%{
				background-position: 100% 50%;
			}
			100%{
				background-position: 0% 50%;
			}
		}
	}

	.priceChange .priceTitle .iconfont {
		position: absolute;
		font-size: 40upx;
		right: 26upx;
		top: 23upx;
		width: 40upx;
		height: 40upx;
		line-height: 40upx;
	}

	.priceChange .listChange {
		width: 100%;
		padding: 0 20rpx;
	}

	.priceChange .listChange textarea {
		box-sizing: border-box;
	}

	.priceChange .listChange .item {
		height: 103upx;
		border-bottom: 1px solid #e3e3e3;
		font-size: 32upx;
		color: #333;
	}

	.priceChange .listChange .title {
		font-size: 32rpx;
		text-align: center;
		margin-top: 52rpx;
	}

	.priceChange .listChange .item .money {
		color: #666;
		width: 300upx;
		text-align: left;
	}

	.priceChange .listChange .item .money .iconfont {
		font-size: 32upx;
		margin-left: 20upx;
	}

	.priceChange .listChange .item .money input {
		width: 100%;
		height: 100%;
		text-align: left;
		color: #ccc;
		padding-left: 20rpx;
	}

	.priceChange .listChange .item .money input.on {
		color: #666;
	}

	.priceChange .modify {
		font-size: 32upx;
		color: #fff;
		width: 490upx;
		height: 90upx;
		text-align: center;
		line-height: 90upx;
		border-radius: 45upx;
		background-color: #2291f8;
		margin: 53upx auto 0 auto;
	}

	.priceChange .modify1 {
		font-size: 32upx;
		color: #312b2b;
		width: 490upx;
		height: 90upx;
		text-align: center;
		line-height: 90upx;
		border-radius: 45upx;
		background-color: #eee;
		margin: 30upx auto 0 auto;
	}

	.priceChange .listChange textarea {
		border: 1px solid #eee;
		width: 100%;
		height: 200upx;
		margin-top: 50upx;
		border-radius: 10upx;
		color: #333;
		padding: 10rpx 14rpx;
		box-sizing: border-box;
	}
</style>